import {
    createRouter,
    createWebHistory,
    createWebHashHistory
} from 'vue-router'

const routes = [
    {
        path: '/',
        // component: Layout,
        name: 'base',
        redirect: '/home',
        meta: {
            zh: '首页'
        },
    },
    {
        path: "/home",
        component: () => import("@/views/customHome/index.vue"),
        meta: {
            title: "Dashboard"
        },
    }
]
// 创建路由模式
const router = createRouter({
    history: createWebHashHistory(),
    // routes
    // history: createWebHistory(),
    routes,
    // strict: false,
    // 切换页面，滚动到最顶部
    // scrollBehavior: () => ({
    //     left: 0,
    //     top: 0
    // })
})
router.beforeEach((to, from, next) => {
    console.log(to)

    next()
})
export default router